# Mission 4 Lesson 3 # Objectives 8-11 from botcore import * from time import sleep from random import randrange def note(freq, duration): spkr.pitch(freq) sleep(duration) spkr.off() sleep(0.05) note(349, 0.4) while True: if buttons.was_pressed(0): break motors.enable(True) # Move forward 2 feet motors.run(LEFT, 80) motors.run(RIGHT, 80) sleep(2) # Spin 360 degrees motors.run(LEFT, 30) motors.run(RIGHT, -30) sleep(3.75) count = 0 while count < 10: count = count + 1 f = randrange(100, 1000) spkr.pitch(f) sleep(0.1) spkr.off()